import QtQuick 2.0
import QtQuick.Controls 2.3
import QtCharts 2.3
import QtQuick.Layouts 1.3

Item {
    id:root96
    width: 850
    height: 580
    property real minSize:  Math.min(width/850, height/580)

    signal qmlSN_sqlWriteFinish()
    onQmlSN_sqlWriteFinish: {
        if(sw.currentIndex!=5 || main_svshow.currentIndex!=9) {
            return;
        }

        var t_dataValueOf = new Date().valueOf()
        page_9EO_6phaseStepA.addLinePoint(
                    t_dataValueOf,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套机端电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套励磁电流")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套自动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套手动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套系统电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套控制信号")*0.01
                    )
        page_9EO_6phaseStepB.addLinePoint(
                    t_dataValueOf,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套机端电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套励磁电流")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套自动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套手动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套系统电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套控制信号")*0.01
                    )
    }
    onFocusChanged:{
        if(!focus)
        {
        }
        else{
            page_9EO_6phaseStepA.clearAll()
            page_9EO_6phaseStepB.clearAll()
            page_9EO_6phaseStepA.refurbish()
            page_9EO_6phaseStepB.refurbish()
            page_9EO_6phaseStepA.moveAxisToSight()
            page_9EO_6phaseStepB.moveAxisToSight()
        }
    }

    function clearAll()
    {
        page_9EO_6phaseStepA.clearAll()
        page_9EO_6phaseStepB.clearAll()
    }

    SwipeView
    {
        id: sv_p96
        x: 0
        y: 0
        width:parent.width
        height: parent.height*0.85
        clip: true
        interactive: false
        Component.onCompleted:{contentItem.highlightMoveDuration = 0}

        Page_09EO_6phaseStepA{
            id: page_9EO_6phaseStepA
            Text {
                id: name1
                text: qsTr("A通道阶跃波形")
                anchors.topMargin:  parent.height*0.06
                anchors.horizontalCenter: parent.horizontalCenter
                font.pixelSize: 22*minSize
                color: "#44fdfd"
            }}

        Page_09EO_6phaseStepB{
            id: page_9EO_6phaseStepB
            Text {
                id: name
                text: qsTr("B通道阶跃波形")
                anchors.topMargin:  parent.height*0.06
                anchors.horizontalCenter: parent.horizontalCenter
                font.pixelSize: 22*minSize
                color: "#44fdfd"

            }}

        onCurrentIndexChanged: {
            if(sv_p96.currentIndex==0) {button_channelA.checked=true;button_channelB.checked=false}
            if(sv_p96.currentIndex==1) {button_channelB.checked=true;button_channelA.checked=false}
        }
    }

    EXC_Normal_BtnUncheckStyle {
        id: button_channelA
        x: 266
        y: 519
        width: parent.width*0.13
        height: parent.height*0.08
        nameFontpixelSize: 25*root96.minSize
        nameText: qsTr("A通道")
        checked: true
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.25
        anchors.topMargin: parent.height/32
        anchors.top: sv_p96.bottom
        onClicked: {
            if(sv_p96.currentIndex==0) checked = true;
            else sv_p96.currentIndex = 0
        }
    }

    EXC_Normal_BtnUncheckStyle {
        id: button_channelB
        x: 487
        y: 519
        width: parent.width*0.13
        height: parent.height*0.08
        nameFontpixelSize: 25*root96.minSize
        nameText: qsTr("B通道")
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.65
        anchors.topMargin: parent.height/32
        anchors.top: sv_p96.bottom
        onClicked: {
            if(sv_p96.currentIndex==1) checked = true;
            else sv_p96.currentIndex = 1
        }
    }

}

/*##^##
Designer {
    D{i:0;formeditorZoom:1.25}
}
##^##*/
